<?
include '../config.inc.php';
$username = @$_POST['username'];
$password = @$_POST['password'];
$set_username=@$_POST['set_username'];
$set_nickname=@$_POST['set_nickname'];
$set_talk=@$_POST['set_talk'];
$set_admin=@$_POST['set_admin'];

if($set_talk == 1){
   
}else if($set_talk ==0){
   
 }else{
   echo '状态设置错误 0为正常 1为禁言';
   exit;
 }
if($set_username == ''){
   echo '被修改人的账号错误';
   exit;
}
if($set_nickname == ''){
   echo '修改的昵称不能为空';
   exit;
}
if($set_talk == ''){
   echo '修改的状态不能为空';
   exit;
}
if($set_admin == ''){
   echo '修改的身份不能为空';
   exit;
}
include '../member.php';
if($admin !=1){
  echo '你没有权限操作';
  exit;
}
if(!mysql_query("update wwk_chat_user set nickname='{$set_nickname}',talk='{$set_talk}',type='{$set_admin}' WHERE username='{$set_username}'")){
   echo '更新数据库错误！';
   exit;
}
if(!mysql_query("update wwk_chat_msg set nickname='{$set_nickname}',type='{$set_admin}' WHERE username='{$set_username}'")){
   echo '更新msg数据库错误！';
   exit;
}
echo '操作成功';

?>